<div class="visit-theme page-content ">
	<form nz-form [formGroup]="validateForm" class="page-header">
		<div nz-row [nzGutter]="24">
			<div nz-col [nzSpan]="6">
				<nz-form-item>
					<nz-form-label nzFor="discloseTitle">爆料主题</nz-form-label>
					<nz-form-control>
						<input nz-input placeholder="请填写" formControlName="discloseTitle" />
					</nz-form-control>
				</nz-form-item>
			</div>
			<div nz-col [nzSpan]="6" [nzOffset]="12">
				<nz-form-item style="float: right;">
					<button nz-button *ngIf="authList.includes(authEnum.DISCLOSE_TITLE_VIEW)" style="margin-right: 10px;" (click)="onSearch(true)">
						<i nz-icon nzType="search"></i>
						搜索
					</button>
					<button nz-button *ngIf="authList.includes(authEnum.DISCLOSE_TITLE_ADD)" nzType="primary" (click)="create()">
						<i nz-icon nzType="plus"></i>
						新增
					</button>
				</nz-form-item>
			</div>
		</div>

	</form>


	<nz-table #basicTable [nzData]="data" [nzBordered]="true" [nzShowPagination]="false" nzSize="middle"
	[nzScroll]="{y: 'calc(100vh - 190px)'}" [nzLoading]="nzLoading" [nzPageSize]="page.limit">
		<thead>
			<tr>
				<th nzAlign="center" nzWidth="100px">序号</th>
				<th nzAlign="center" nzWidth="15%">爆料主题</th>
				<th nzAlign="center" nzWidth="300px">部门名称</th>
				<th nzAlign="center" nzWidth="auto">备注</th>
				<th nzAlign="center" nzWidth="150px">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr *ngFor="let item of basicTable.data; let i = index;">
				<td nzAlign="center">{{ i + 1}}</td>
				<td nzAlign="center">
					<ng-container *ngIf="editData?.id !== item.id">
						{{item.discloseTitle}}
					</ng-container>
					<ng-container *ngIf="editData?.id === item.id">
						<input nz-input [(ngModel)]="editData.discloseTitle">
					</ng-container>
				</td>
				<td nzAlign="center">
					<ng-container *ngIf="editData?.id !== item.id">
						<span class="line-clamp" nz-tooltip [nzTooltipTitle]="item.dept">
							{{item.dept}}
						</span>
					</ng-container>
					<ng-container *ngIf="editData?.id === item.id">
						<nz-cascader style="width: 100%;" [nzOptions]="departOption" [(ngModel)]="editData.deptId"> </nz-cascader>
					</ng-container>
				</td>
				<td nzAlign="center">
					<ng-container *ngIf="editData?.id !== item.id">
						<span class="line-clamp" nz-tooltip [nzTooltipTitle]="item.remark">
							{{item.remark}}
						</span>
					</ng-container>
					<ng-container *ngIf="editData?.id === item.id">
						<input nz-input [(ngModel)]="editData.remark">
					</ng-container>
				</td>
				<td nzAlign="center">
					<ng-container *ngIf="editData?.id !== item.id">
						<ng-container *ngIf="authList.includes(authEnum.DISCLOSE_TITLE_EDIT)">
							<a (click)="edit(item)">编辑</a>
						</ng-container>
						<nz-divider *ngIf="authList.includes(authEnum.DISCLOSE_TITLE_EDIT) && authList.includes(authEnum.DISCLOSE_TITLE_DEL)" nzType="vertical"></nz-divider>
						<ng-container *ngIf="authList.includes(authEnum.DISCLOSE_TITLE_DEL)">
							<a nz-popconfirm nzPopconfirmTitle="确定删除吗?" (nzOnConfirm)="del(item)">删除</a>
						</ng-container>
					</ng-container>
					<ng-container *ngIf="editData?.id === item.id">
						<a (click)="save(item)">保存</a>
						<nz-divider nzType="vertical"></nz-divider>
						<a (click)="cancel()">取消</a>
					</ng-container>
				</td>
			</tr>
		</tbody>
	</nz-table>

	<div class="page-pagination">
		<span *ngIf="page.total">共{{page.total}}条数据</span>
		<nz-pagination [(nzPageIndex)]="page.page" [nzTotal]="page.total" nzShowQuickJumper nzShowSizeChanger [(nzPageSize)]="page.limit" (nzPageIndexChange)="onSearch()" (nzPageSizeChange)="onSearch(true)"></nz-pagination>
	</div>

</div>